#include "stdafx.h"
#include ".\tempstoreslotcontainer.h"
#include ".\ItemManager.h"
#include ".\Player.h"

CTempStoreSlotContainer::CTempStoreSlotContainer()
{
	Init( MAX_TEMPINVENTORY_SLOT_NUM, SI_TEMPINVENTORY );
}

CTempStoreSlotContainer::~CTempStoreSlotContainer(void)
{
}

BOOL CTempStoreSlotContainer::InsertSlot( POSTYPE AtPos, SCSlot & IN rSlot )
{
	if( SCSlotContainer::InsertSlot( AtPos, rSlot ) )
	{
		m_pPlayer->GetItemManager()->AddSerialCode( GetSlotIdx(), rSlot.GetSerial() );
		
		return TRUE;
	}
	else 
		return FALSE;
}


VOID CTempStoreSlotContainer::DeleteSlot( POSTYPE AtPos, SCSlot * pSlotOut )
{
	m_pPlayer->GetItemManager()->RemoveSerialCode( GetSlot(AtPos).GetSerial() );
	SCSlotContainer::DeleteSlot( AtPos, pSlotOut );
}
